const path = require('path');
const { resolveApp } = require('./paths')
const { merge } = require('webpack-merge')
const common = require('./webpack.common');

const config = {
	// 输出
  output: {
    // bundle 文件名称
    filename: '[name].bundle.js',    
    // bundle 文件路径
    path: resolveApp('dist'),    
    // 编译前清除目录
    clean: true
  },
	// 开发模式
  mode: 'development',
	devServer: {
    // 告诉服务器从哪里提供内容，只有在你想要提供静态文件时才需要。
    static: {
      directory: path.join(__dirname, 'public'),
    },
    compress: true,
    port: 9000,
  },
}

module.exports = merge(common, config);